﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class TourPartySettlement
    {
        private Guid _id = Guid.NewGuid();
        [DataMember]
        public Guid ID
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _ref = string.Empty;
        [DataMember]
        public string Ref
        {
            get { return _ref; }
            set { _ref = value; }
        }

        private string _status = string.Empty;
        [DataMember]
        public string Status
        {
            get { return _status; }
            set { _status = value; }
        }

        private DateTime _orderDate = DateTime.Now;
        [DataMember]
        public DateTime OrderDate
        {
            get { return _orderDate; }
            set { _orderDate = value; }
        }

        private string _customer = string.Empty;
        [DataMember]
        public string Customer
        {
            get { return _customer; }
            set { _customer = value; }
        }

        private string _name = string.Empty;
        [DataMember]
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private decimal _totalPrice;
        [DataMember]
        public decimal TotalPrice
        {
            get { return _totalPrice; }
            set { _totalPrice = value; }
        }

        //已支付金额
        //private decimal _payenPrice;
        //[DataMember]
        public decimal PayedPrice
        {
            get 
            {
                decimal result = 0;
                foreach (TourPartySettlementDetail detail in PayedDetail)
                    result += detail.Price;

                return result;
            }
        }

        //已支付明细
        private List<TourPartySettlementDetail> _payedDetail = new List<TourPartySettlementDetail>();
        [DataMember]
        public List<TourPartySettlementDetail> PayedDetail 
        {
            get { return _payedDetail; }
            set { _payedDetail = value; }
        }
    }
}
